package com.doctcloud.hisinfo.histable.domain.insurance;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.TableDesc;
import lombok.*;

import java.io.Serializable;

import static com.doctcloud.common.core.utils.StringUtils.trim;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode(of = {"insuranceType","lowLevel"})
@TableDesc("门诊病人医疗保险支付方案")
public class PaySchemaForOutpDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "医保类型")
    private String insuranceType;
    @Excel(name = "医疗费区间下限")
    private Double lowLevel;
    @Excel(name = "医疗费区间上限")
    private Double upperLevel;
    @Excel(name = "个人支付比分子")
    private Integer proportionNumerator;
    @Excel(name = "个人支付比分母")
    private Integer proportionDenominator;

    @Data
    public static class primaryKey {
        private final String insuranceType;
        private final Double lowLevel;
        public primaryKey(String insuranceType, Double lowLevel) {
            this.insuranceType = insuranceType;
            this.lowLevel = lowLevel;
        }
    }

    public void setInsuranceType(String insuranceType) {
        this.insuranceType = trim(insuranceType);
    }
}
